Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#443 - DataTable arguments aren't working with cucumber-scala #455

Merged
merged 16 commits into from
Mar 10, 2013
Merged

#443 - DataTable arguments aren't working with cucumber-scala #455

merged 16 commits into from
Mar 10, 2013

Conversation

notmattlucas
Copy link
Contributor

Hi,

I've had a go at resolving #443 for Scala, and started the move towards using core for all data transformations, rather than treating all types as Strings until the Scala layer as was before. At the very least it should provide some insight into the issue and some more comprehensive tests around the type mappings.

Cheers

Matt

@aslakhellesoy
Copy link
Contributor

Does this respect the Locale of the feature file? For example the String "1,000" converts to the number 1 in French and 1000 in English.

The Java transformations respect the Locale. Would it be possible to make the Scala code use the Java transformations as they are already quite elaborate? They also support date conversions.

@notmattlucas
Copy link
Contributor Author

I don't believe so, as the Scala layer (as far as I can tell) has basically always treated every type as a String through the core ParameterInfo bits and pieces - hence why the DataTable was failing (could not be represented as a string and then converted in the Scala layer as the other, more primitive, types could).

Sure, I'll have a look at making the Scala layer use the Java transformations - will be a bigger change, but makes most sense in the long run.

@aslakhellesoy
Copy link
Contributor

Thanks, shall I merge this in the interim?

@notmattlucas
Copy link
Contributor Author

Hi, don't worry about merging in yet - I'm almost done with the extra refactoring now.

Just want to write some additional tests (specifically concerning the custom object converters, which weren't previously supported), before merging over.

Should be done pretty soon - cheers.

@notmattlucas
Copy link
Contributor Author

Hi, should be good to go now.

I've refactored (as discussed) the Scala layer to use the core type-transformation, which should now enable the following functionality which I don't believe previously worked :

  • DataTable argument.
  • Custom object with string constructor as argument.
  • Use of the XStreamConverter annotation to use a custom object as argument.

and added appropriate cucumber tests to exercise the functionality.

Let me know if there's anything else you need.

Cheers

Matt

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants